//GUITable displays a table of the inputter health updates

import java.awt.*;
import java.awt.event.*;

import javax.swing.*;

public class GUITable extends JPanel{
        private JPanel panel;
        private JPanel left;
        private JPanel center;
        private JPanel right;
        
    public GUITable(Patient p)
    {
        left = new JPanel();
        left.setLayout(new BoxLayout(left, BoxLayout.Y_AXIS));
        left.add(new JLabel("Sugar Level"));
        left.setBorder(BorderFactory.createEtchedBorder());
        for(int i = 0; i < p.getSize(); i++)
        {
            left.add(new JLabel(p.sToStringAt(i)));
        }
        
        
        
        center = new JPanel();
        center.setLayout(new BoxLayout(center, BoxLayout.Y_AXIS));
        center.setBorder(BorderFactory.createEtchedBorder());
        center.add(new JLabel("Blood Pressure"));
        for(int i = 0; i < p.getSize(); i++)
        {
            center.add(new JLabel(p.pToStringAt(i)));
        }
        
        right = new JPanel();
        right.setLayout(new BoxLayout(right, BoxLayout.Y_AXIS));
        right.setBorder(BorderFactory.createEtchedBorder());
        right.add(new JLabel("Weight"));
        for(int i = 0; i < p.getSize(); i++)
        {
            right.add(new JLabel(p.wToStringAt(i)));
        }
        
        panel = new JPanel();
        panel.setLayout(new BorderLayout());
        panel.add(left, BorderLayout.WEST);
        panel.add(center, BorderLayout.CENTER);
        panel.add(right, BorderLayout.EAST);
        
        this.add(panel);
    }
    
    
    
}
